home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Kit PC World De Ampliacion De Windows 95
/
Kit PC World de ampliacion de Windows 95.iso
/
clarion
/
gauge
/
gauge.z
/
DDIALOG.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-08-24
|
2KB
|
87 lines
unit Ddialog;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, Ddialog1, Clipbrd, DdeMan;
const
Displays = 40;
type
TDialog = class(TForm)
Label1: TLabel;
DisplaysPerMinute: TLabel;
Label2: TLabel;
Run: TButton;
Exit: TButton;
DPDIALOG: TDdeServerConv;
DdeServerItem1: TDdeServerItem;
procedure RunClick(Sender: TObject);
procedure DDEOpen(Sender: TObject);
procedure ExitClick(Sender: TObject);
procedure FormPaint(Sender: TObject);
procedure ExitEnter(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Dialog: TDialog;
Start: LongInt;
Stop: LongInt;
I: Integer;
OneShot: Integer;
DspsPerMin: Real;
implementation
{$R *.DFM}
procedure TDialog.RunClick(Sender: TObject);
begin
Run.Enabled := False;
Exit.Enabled := False;
Screen.Cursor := crHourglass;
Start := GetTickCount;
For I := 1 to Displays Do
begin
PersonalInfo.ShowModal;
PersonalInfo.Update;
end;
PersonalInfo.Close;
Stop := GetTickCount;
DspsPerMin := Displays * 60000 / (Stop - Start);
DisplaysPerMinute.Caption := Format( '%10.0n',[DspsPerMin]);
ClipBoard.AsText := Format( '%10f',[DspsPerMin]);
Run.Enabled := True;
Exit.Enabled := True;
Screen.Cursor := crDefault;
if OneShot = 1 then Exit.SetFocus;
end;
procedure TDialog.DDEOpen(Sender: TObject);
begin
OneShot := 1;
Run.Click;
end;
procedure TDialog.ExitClick(Sender: TObject);
begin
Dialog.Close;
end;
procedure TDialog.FormPaint(Sender: TObject);
begin
Dialog.WindowState := wsMaximized;
end;
procedure TDialog.ExitEnter(Sender: TObject);
begin
if OneShot = 1 then Exit.Click;
end;
end.